package com.crl.map.unit.ele
{
	import com.crl.map.core.MapLoaderManager;
	import com.crl.map.unit.def.AbstractDef;
	import com.crl.map.unit.view.IEleView;
	import com.crl.net.loader.StreamLoader;
	
	import flash.display.Graphics;

	/**
	 * 对于背景加载的项; 
	 * @author crl
	 * 
	 */	
	public class BgEle extends AbstractEle
	{
		public static const W:int;
		public static const H:int;
		
		private var d:AbstractDef;
		public function BgEle(d:AbstractDef)
		{
			super();
			
			d=def;
		}
		
		override public function create(def:AbstractDef):void{
			d=def;
			super.create(def);
		}
		
		override public function getToken(path:String):RemoteToken{
			MapLoaderManager.ins.loadBackground(path);
		}
		
		override public function render(g:Graphics, def:AbstractDef):void{
			g.beginBitmapFill(bmd);
			g.drawRect(d.x,d.y,W,H);
			g.endFill();
		}
	}
}